/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package be.ugent.medirem.logic;

import be.ugent.medirem.persistence.entity.details.MeasurementDetails;
import be.ugent.medirem.persistence.entity.details.MeasurementTypeDetails;
import be.ugent.medirem.persistence.entity.values.MeasurementTypeValues;
import be.ugent.medirem.persistence.entity.values.MeasurementValues;
import be.ugent.medirem.persistence.exception.EntityNotFoundException;
import java.util.List;
import javax.annotation.security.RolesAllowed;
import javax.ejb.Remote;

/**
 *
 * @author Thomas Roelens
 */
@Remote
public interface MeasurementRemote {

    @RolesAllowed({"gp", "patient"})
    void addMeasurement(Long patientId, MeasurementValues details);

    @RolesAllowed({"gp"})
    void removeMeasurement(Long patientId, Long measurementId);

    @RolesAllowed({"gp", "patient"})
    List<MeasurementDetails> getMeasurements(Long patientId, String measurementType);

    @RolesAllowed({"gp", "patient"})
    List<MeasurementDetails> getAllMeasurements(Long patientId);

    @RolesAllowed({"gp", "patient"})
    MeasurementDetails getLatestMeasurement(Long patientId, String measurementType);

    @RolesAllowed({"gp", "patient"})
    MeasurementDetails getMeasurementDetails(Long measurementId) throws EntityNotFoundException;

    @RolesAllowed({"gp", "patient"})
    void updateMeasurement(MeasurementValues details);

    @RolesAllowed({"gp"})
    Long createMeasurementType(MeasurementTypeValues detail) throws IllegalArgumentException;

    @RolesAllowed({"gp"})
    void removeMeasurementType(Long id) throws IllegalArgumentException, EntityNotFoundException;

    @RolesAllowed({"gp", "patient"})
    MeasurementTypeDetails getMeasurementType(Long id) throws IllegalArgumentException;

    @RolesAllowed({"gp", "patient"})
    List<MeasurementTypeDetails> getAllMeasurementTypes();

    @RolesAllowed({"gp", "patient"})
    String getMeasurementTypeUnit(String measurementType);
}
